home *** CD-ROM | disk | FTP | other *** search
- README - Java(tm) Servlet Development Kit (JSDK) 1.0.1
- ------
- The Java Servlet Development Kit (JSDK) can be used to develop and test
- server extensions based on the servlet API. Included is a standalone
- server (called the ServletRunner) that can be used to test servlets
- before running them in a servlet-enabled web server.
-
- In addition to the ServletRunner, code to run servlets in the following
- commercial web servers is provided in this release:
-
- Netscape Enterprise and FastTrack 2.x
- Netscape Enterprise 3.0beta3
- (see README.netscape for more information)
- Microsoft IIS 2.x and 3.x
- Apache
- (see README.apache for more information)
-
- Please note that the code for these implementations is released with this
- package.
-
- Files included in the JSDK:
-
- README this file
- README.netscape installation instructions for Netscape servlet support
- README.apache installation instructions for Apache servlet support
- bin/srun.exe ServletRunner (on Win32 systems only)
- bin/srun ServletRunner (on UNIX systems only)
- lib/classes.zip javax.servlet and sun.servlet classes
- src javax.servlet and sun.servlet.netscape class sources
- sBETAervlets sample servlets and source code
- doc/apidoc api documentation
-
-
- Bugs fixed in this release:
-
- Bug 4059897 - POST operations combined with keepalive will no longer throw spurious Invalid Request exceptions.
-
- Bug 4056742 - Win32 installer allows product to register user specified
- directory rather what's set as the default directory.
-
-
- Starting the Servlet Runner
- ---------------------------
- Before starting the servlet runner, first add the JSDK bin directory to
- your search path:
-
- % setenv PATH /usr/local/jsdk/bin:$PATH (on UNIX)
-
- C> set PATH=C:\jsdk;%PATH% (on Win32)
-
- Then, start the servlet runner:
-
- % srun -d <servlet-dir> -r <document-dir> (on UNIX)
-
- C> srun -d <servlet-dir> -r <document-dir> (on Win32)
-
- The argument <servlet-dir> specifies the directory containing servlets
- and <document-dir> is the document root directory for serving web pages.
- The default for both directories is the current directory, so if the
- servlet you are testing is in the current directory then no arguments need
- to be specified. In addition, the following options are recognized by the
- ServlerRunner, along with the default values if not specified:
-
- -p port port number to listen on (8080)
- -b backlog backlog parameter for accepting new connections (50)
- -m max maximum number of connection handlers (100)
- -t timeout connection timeout in milliseconds (5000)
- -d dir servlet directory (current directory)
- -r root document root directory (current directory)
- -s filename servlet properties file (<servletdir>/servlets.properties)
- -v generate verbose output (off)
-
- Invoking Servlets
- -----------------
- The standard way to invoke a servlet in any server is with a URI like the
- following:
-
- /servlet/<servlet-name>/<path-info>?<query-args>
-
- The name of the servlet is <servlet-name> and is the class name of the
- servlet, <path-info> is optional path information for the servlet, and
- <query-args> is optional query string arguments for the servlet.
-
- For example, if you had started the ServletRunner on host 'eno' within
- the directory 'servlets' containing sample servlets, then from any browser
- you could run the "snoop" servlet with the following URL:
-
- http://eno:8080/servlet/SnoopServlet/foo/bar?a=z
-
- This will invoke SnoopServlet with path info '/foo/bar' and query string
- 'a=z'. The SnoopServlet will echo the request headers and query string
- arguments back to the client.
-
- Initialization Parameters
- -------------------------
-
- Servlet initialization parameters can be set in the servlet runner just as
- they can in the JavaWebServer. To set them you need to follow these steps:
-
- 1) Create a servlets.properties file. This file will contain the name of
- the servlet and the initialization parameters of the servlet, in this
- format:
-
- servlet.<servletname>.code=<servletclass>
- servlet.<servletname>.initArgs=<name=value>,<name=value>
-
- For example:
-
- servlet.snoop.code=SnoopServlet
- servlet.snoop.initArgs=test1=1,test2=2
-
- 2) Either place the properties file in the default location (which will
- be your servlet directory, named servlets.properties), or specify the
- name of the servlets.properties file on startup with the -s arg.
-
- Now, if you call up SnoopServlet with the name snoop, as in
-
- http://host:port/servlet/snoop
-
- it's output will include the two init parameters. Calling the servlet by
- class, as in
-
- http://host:port/servlet/SnoopServlet
-
- will report no init parameters.
-
-
- Testing your setup
- ------------------
-
- To test your setup and ensure that it works correctly, start the Servlet Runner
- as described above, then call up a servlet in your browser. A good test
- servlet to try is SnoopServlet
-
- Limitations
- -----------
- Current limitations:
-
- If a servlet class file is changed, then you will need to restart the
- server in order for the change to take effect.
-
- Problems
- --------
- If you have any questions or problems with the this JSDK 1.0 release
- then please send email to java-server-feedback@javasoft.com.
-
- For more discussion of servlets, consider joining the JSERV-INTEREST mailing
- list. For information on subscribing to this list, check our webpage at
- http://jserv.javasoft.com/
-